﻿// 1.1.3.14. Write an expression that checks if given positive integer number n (n ≤ 100) is prime. E.g. 37 is prime.

using System;

class IsItPrime
{
    static void Main()
    {
        Begin:
        Console.Write("Please enter any number 1 < number < 100 to check is it prime or not: ");
        byte number = byte.Parse(Console.ReadLine());
        bool isItPrime = true;
        if (number != 2)
        {
            for (int i = 2; i <= Math.Sqrt(number); i++)
            {
                if (number % i == 0)
                {
                    isItPrime = false;
                    break;
                }
            }
        }
        if (isItPrime == true)
        {
            Console.WriteLine("The number {0} is prime.", number);
        }
        else
        {
            Console.WriteLine("The number {0} is not prime.", number);
        }
        Console.WriteLine();
        goto Begin;
    }
}